{% extends "user/base.html" %}
{% load i18n %}

{% block head-title %}{% trans "Change language" %} - {% endblock %}

{% block account-content %}
    <h1>{% trans 'Change language' %}</h1>
    <section>
        <form action="{% url 'set_language' %}" method="post">
            {% csrf_token %}
            <input name="next" type="hidden" value="{{ redirect_to }}">
            <div class="form-group">
                <label title="{% trans 'required field' %}" class="control-label" for="language">{% trans 'Language' %}<span class="required-field">*</span></label>

                <select name="language" id="language" class="form-control">
                    {% get_current_language as LANGUAGE_CODE %}
                    {% get_available_languages as LANGUAGES %}
                    {% get_language_info_list for LANGUAGES as languages %}
                    {% for language in languages %}
                        <option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
                            {{ language.name_local }} ({{ language.code }})
                        </option>
                    {% endfor %}
                </select>
            </div>
            <p><input type="submit" class="btn btn-primary btn-block" value="{% trans 'Change language' %}"></p>
        </form>
    </section>
{% endblock %}



